package com.company.Thread;

/**
 * @ProjectName: 复习java
 * @Package: com.company.Thread
 * @ClassName: TestThreadLoad
 * @Author: wym
 * @Date: 2020/8/10 13:16
 * @Version: 1.0
 */
public class TestThreadLoad {
    /**
     *
     */
    private static ThreadLocal<String>  local=new ThreadLocal<>();
    public static void main(String[] args) throws InterruptedException {
        local.set("main");
        System.out.println(local.get());
        Thread chlidThread=new Thread(()->{
            local.set("child");
            System.out.println(local.get());
        });
        chlidThread.start();
        chlidThread.join();
        System.out.println(local.get());
    }
}
